﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Utilities
{
    public class ProgrammingLanguage
    {
        public enum Languages
        {
            C,
            Cpp,
            Java,
            Javascript,
            CSharp,
            VisualBasic,
            Ruby
        }

        public Languages Language { get; set; }

        public string Version { get; set; }

        public string FileExtension { get; set; }

        public override string ToString()
        {
            return GetLanguageName() + " " + Version;
        }

        private string GetLanguageName()
        {
            switch (Language)
            {
                case Languages.C: return "C";
                case Languages.Cpp: return "C++";
                case Languages.Java: return "Java";
                case Languages.Javascript: return "Javascript";
                case Languages.CSharp: return "C#";
                case Languages.VisualBasic: return "Visual Basic";
                case Languages.Ruby: return "Ruby";
                default: throw new NotImplementedException();
            }
        }

        public static ProgrammingLanguage CSharp4
        {
            get
            {
                return new ProgrammingLanguage
                {
                    Language = Languages.CSharp,
                    Version = "4",
                    FileExtension = ".cs"
                };
            }
        }

        public static ProgrammingLanguage Javascript1_8
        {
            get
            {
                return new ProgrammingLanguage
                {
                    Language = Languages.Javascript,
                    Version = "1.8",
                    FileExtension = ".js"
                };
            }
        }

        public static ProgrammingLanguage Ruby2_2
        {
            get
            {
                return new ProgrammingLanguage
                {
                    Language = Languages.Ruby,
                    Version = "2.2",
                    FileExtension = ".rb"
                };
            }
        }
        
    }
}
